package com.vert.auth.controller;

import com.alibaba.fastjson.JSONObject;
import com.vert.annotations.*;
import com.vert.auth.model.UserModel;
import com.vert.auth.service.UserModelService;
import com.vert.db.model.IPage;
import com.vert.utils.Results;

/**
 * @Classname UserModelController
 * @Description TODO
 * @Date 2022/6/2 12:47
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@RestController("/user")
public class UserModelController {

    @Autowired
    private UserModelService userModelService;

    @GetMapping("/getuser")
    public JSONObject getUserController(@Param("username")String username){
        UserModel userModel=userModelService.getUserModel(username);
      System.out.println("haa");
        return Results.success(userModel);
    }

    @GetMapping("/page")
    public JSONObject getPageController(@Param("page")Integer page,
                                        @Param("pageNum")Integer pageSize){
        IPage<UserModel> iPage=userModelService.getUserModelPage(page,pageSize);
        return Results.success(iPage);
    }





}
